#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <string>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    s = ' ' + s;
    vector<string>ans;
    for(char c1 = 'a'; c1 <= 'z'; c1 ++)
    {
        for(char c2 = 'a'; c2 <= 'z'; c2 ++)
        {
            if(c2 == c1) continue;
            auto ss = s;
            int cnt = 0;
            for(int i = 1; i <= n - 2; i ++)
            {
                if(ss[i] == c1 && ss[i + 1] == c2 && ss[i + 2] == c2)
                {
                    ss[i] = ss[i + 1] = ss[i + 2] = '#';
                    cnt++;
                }
            }
            int flag = 0;
            for(int i = 1; i <= n - 2; i ++)
            {
                if(ss[i] == '#' || ss[i + 1] == '#' || ss[i + 2] == '#') continue;
                if(ss[i] == c1 && ss[i + 1] == c2 || ss[i + 2] == c2 && ss[i + 1] == c2 || ss[i] == c1 && ss[i + 2] == c2)
                {
                    flag = 1;
                    break;
                }
            }
            if(cnt + flag >= m)
            {
                string ssx;
                ssx += c1;
                ssx += c2;
                ssx += c2;
                ans.push_back(ssx);
            }
        }
    }
    cout << ans.size() << endl;
    for(auto x : ans)
    {
        cout << x << endl;
    }
}